package br.com.iswe.gwt.crud.server.controller;

import java.util.List;

import br.com.iswe.core.entidades.gwt.BeanMap;
import br.com.iswe.core.entidades.gwt.RemoteEntityObject;
import br.com.iswe.gwt.ui.client.QueryInfo;
import br.com.iswe.gwt.ui.client.RequestInfo;

/**
 * 
 * This interface defines the contract of a Domain controller and requires the domain
 * to be specified.
 * 
 * @author Rafael
 *
 * @param <ENTITY>
 */
public interface GwtDomainController<ENTITY extends RemoteEntityObject> {

	ENTITY save(ENTITY entity, RequestInfo requestInfo);
	
	Boolean delete(ENTITY entity);
	
	List<ENTITY> getAllObjects(QueryInfo queryInfo);
	
	List<ENTITY> getObjects(ENTITY entity, QueryInfo queryInfo);
	
	ENTITY detail(ENTITY entity, QueryInfo queryInfo);

	ENTITY associarManyToManyAsEntity(BeanMap bean, RequestInfo requestInfo);

	ENTITY removerManyToManyAsEntity(BeanMap bean, RequestInfo requestInfo);
	
}
